package d3_inner_class3;

public class Test2 {
    public static void main(String[] args) {
        /**
         * 内部类
         */
        Swimming s1 = new Swimming(){
            @Override
            public void swim() {
                System.out.println("狗游泳飞快~~~~~");
            }
        };
        go(s1);
    }
    public static void go(Swimming s){
        System.out.println("---------------");
        s.swim();
    }
}
//猫狗都要参加比赛
interface Swimming{
    void swim();

}
